package com.sghd.candy.module.dialog;

import com.sghd.candy.utils.SocketEnum;
import com.sghd.common.socket.core.Message;
import com.sghd.common.socket.session.SessionManager;
import com.sghd.pojo.dialog.Window;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author frank
 * @date 2018-06-08 10:34
 * @desc 弹窗服务
 **/
@Component
public class DialogService {

    @Autowired
    private SessionManager sessionManager;

    /**
     * 弹窗
     * @param type 弹窗类型
     * @param obj  内容
     * @param ids  玩家id
     */
    public void dialog(Window window, Object... ids) {
        Message message = Message.valueOf(SocketEnum.DIALOG_WINDOW, window.getWindows());
        sessionManager.send(message, ids);
    }

}
